::@echo off
SET MirDir=D:\MirandaIM
SET MirProfViDir=D:\MirandaIM\Profiles\V
SET InnoDir=D:\InnoSetup\watcher\{app}
SET LangDir=D:\Sources\langpack_mine
SET ViURL="http://www.miranda-vi.org/report/watcher/"

:CLEANUP
IF EXIST update*.txt DEL /F /Q update*.txt
IF EXIST Langpack_russian.txt DEL /F /Q Langpack_russian.txt

:SVNUPD
svn cleanup
svn update > update.txt
svn log -v -l 20 >> update.txt

:VIMIRDIR
IF EXIST %MirProfViDir%\VersionInfo.txt MOVE /Y %MirProfViDir%\VersionInfo.txt %LangDir%

:VIEXIST
IF EXIST VersionInfo.txt (GOTO GENVILANG) ELSE (goto MIRANDAVI)

:GENVILANG
LangpackSuite.exe \q \o"=MINE=.txt" \l%MirDir%\Langpack_russian.txt
GOTO :MOVEVI

:MIRANDAVI
LangpackSuite.exe \q \o"=MINE=.txt" \u%ViURL% \l%MirDir%\Langpack_russian.txt

:MOVEVI
IF EXIST VersionInfo.txt MOVE /Y VersionInfo.txt C:

:GENFULL
LangpackSuite.exe \q \c \o"=MINE=.txt" \l%InnoDir%\Langpack_russian.txt
IF EXIST C:\VersionInfo.txt MOVE /Y C:\VersionInfo.txt %LangDir%

:SUCCESS
@For /F "tokens=1 delims=/ " %%A in ('Date /t') do set DD=%%A
@For /F "tokens=2 delims=/ " %%B in ('Date /t') do set MM=%%B
@For /F "tokens=3 delims=/ " %%C in ('Date /t') do set YY=%%C
Set CUSTOMDATE=%DD%-%MM%-%YY%
FOR /F "tokens=1-2 delims=: " %%l in ('time /t') do set hhmm=%%l.%%m
ECHO Time: %hhmm%
REN update.txt update-%CUSTOMDATE%%hhmm%.txt
